#include "at_protocol.h"
#include <string.h>
#include <stdarg.h>

at_status_t at_parse_response(const char* expected, const char* actual) {
    if (strstr(actual, "OK")) return AT_OK;
    if (strstr(actual, "ERROR")) return AT_ERROR;
    if (strstr(actual, expected)) return AT_OK;
    return AT_UNKNOWN;
}

const char* at_generate_command(const char* format, ...) {
    static char cmd_buf[256];
    va_list args;
    va_start(args, format);
    vsnprintf(cmd_buf, sizeof(cmd_buf), format, args);
    va_end(args);
    return cmd_buf;
}
